/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package app.controller;

import app.business.RoleSessionBean;
import app.entity.Roles;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author DangThanh
 */
@ManagedBean(name = "roleManagedBean")
@SessionScoped
public class RoleManagedBean {

    @EJB
    private RoleSessionBean roleSessionBean;
    private Roles role;

    public Roles getRole() {
        return role;
    }

    public void setRole(Roles role) {
        this.role = role;
    }

    /**
     * Creates a new instance of RoleManagedBean
     */
    public RoleManagedBean() {
        role = new Roles();
    }

    public List<Roles> getRoles() {
        return roleSessionBean.getAllRoles();
    }
}
